<template>
  <div class="base-title" @click.stop.prevent="goDetail">
    <div class="base-title__wrap">
      <div class="base-title__wrap-left">
        <div v-if="leftIcon === 'red'" class="img">
          <img src="~images/dq.png" alt="">
        </div>
        <div v-else class="img">
          <img src="~images/icon.png" alt="">
        </div>
        <span class="base-title__wrap-title">{{title}}</span>
      </div>
      <span class="rightText">{{rightText}}</span>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: ''
    },
    rightText: {
      type: String,
      default: ''
    },
    leftIcon: {
      type: String,
      default: ''
    },
    // leftIcon: {
    //   type: Object,
    //   default: require('../assets/images/icon.png')
    // }
  },
  data () {
    return {
    }
  },
  methods: {
    // 点击左边返回
    goDetail() {
      this.$emit('goDetail')
    }
  },
}
</script>

<style lang="scss">
.base-title {
  &__wrap {
    border-bottom: 1px solid #1A3F72;
    height: 45px;
    line-height: 45px;
    display: flex;
    justify-content: space-between;
    padding: 0 15px 0 5px;
    &-left {
      display: flex;
    }
    span {
      font-size: 16px;
      color: #fff;
      font-weight: bold;
    }
    .img {
      width: 20px;
      height: 20px;
      line-height: 40px;
      vertical-align: middle;
      padding-right: 5px;
      img {
        width: 20px;
        height: 20px;
        // width: 100%;
        // height: 100%;
        vertical-align: middle;
      }
    }
    .rightText{
    }
  }
}
</style>>
